package main

import (
	"fmt"
	"reflect"
)

func main() {
	a := make([]interface{}, 5)
	a[0] = 1
	a[1] = "1"
	a[2] = 20.1
	for k, v := range a {
		if (v == nil) {
			continue
		}
		fmt.Println(k, v, reflect.TypeOf(v))
	}
	for _, v := range a {
		if (v == nil) {
			continue
		}
		switch v2 := v.(type) {
		case int:
			fmt.Println("int", v2)
			break
		case string:
			fmt.Println("string", v2)
			break
		default:
			fmt.Println(v2)
		}
	}
}
